<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>valueOf() 方法以数字返回数字</title>
</head>

<body>
    <h1>JavaScript 数字方法</h1>
    <p>valueOf() 把数字返回为数字：</p>
    <p id="demo"></p>
    <script>
        var x = 123;
        document.getElementById("demo").innerHTML =
            x.valueOf() + "<br>" +
            (100 + 23).valueOf() + "<br>" +
            (100 + 23).valueOf();
    </script>
</body>

</html>